package com.zui.entity.party;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.zui.entity.BaseAutoIdEntity;
import com.zui.entity.product.Agreement;
import com.zui.entity.product.AgreementItem;
import com.zui.entity.product.Product;
import com.zui.entity.setup.Uom;



@Entity
@Table(name="supplier_product",
uniqueConstraints={@UniqueConstraint(name="uc_supplier_product",
		columnNames={"productId", "partyId", "fromDate"})})
public class SupplierProduct extends BaseAutoIdEntity {
	private static final long serialVersionUID = 1L;
	
	public SupplierProduct() {}
	
	private Product product;
	private Party party;
	private Date fromDate;
	private Date thruDate;
	private SupplierRatingType supplierRatingType;
	private Long standardLeadTimeDays;
	private Long minimumOrderQuantity;
	private Long orderQtyIncrements;
	private Long unitsIncluded;
	private Uom quantityUom;
	private Agreement agreement;
	private AgreementItem agreementItem;
	private Long lastPrice;
	private Uom currencyUom;
	private String supplierProductName;
	private String supplierProductId;
	private String canDropShip;
	private Long supplierCommissionPerc;

	/*------------------------------
	 * getters and annotations
	 --------------------------------*/
	@ManyToOne() @JoinColumn(name="productId")
	public Product getProduct() {return product;}
	@ManyToOne() @JoinColumn(name="partyId")
	public Party getParty() {return party;}
	public Date getFromDate() {	return fromDate;}
	public Date getThruDate() {	return thruDate;}
	@ManyToOne	@JoinColumn(name="supplierRatingTypeId")
	public SupplierRatingType getSupplierRatingType() {	return supplierRatingType;}
	public Long getStandardLeadTimeDays() {	return standardLeadTimeDays;}
	public Long getMinimumOrderQuantity() {	return minimumOrderQuantity;}
	public Long getOrderQtyIncrements() {	return orderQtyIncrements;}
	public Long getUnitsIncluded() {return unitsIncluded;}
	@ManyToOne() @JoinColumn(name="quantityUomId")
	public Uom getQuantityUom() {return quantityUom;}
	@ManyToOne	@JoinColumn(name="agreementId")
	public Agreement getAgreement() {return agreement;	}
	@ManyToOne	@JoinColumn(name="agreementItemId")
	public AgreementItem getAgreementItem() {	return agreementItem;	}
	public Long getLastPrice() {return lastPrice;}
	@ManyToOne() @JoinColumn(name="currencyUomId")
	public Uom getCurrencyUom() {	return currencyUom;	}
	@Column(length=50)
	public String getSupplierProductName() {return supplierProductName;	}
	@Column(length=50)
	public String getSupplierProductId() {return supplierProductId;}
	@Column(length=1)
	public String getCanDropShip() {	return canDropShip;	}
	public Long getSupplierCommissionPerc() {	return supplierCommissionPerc;	}
	
	
	/*------------------------------
	 * setters
	 --------------------------------*/	
	public void setProduct(Product product) {
		this.product = product;
	}
	public void setParty(Party party) {
		this.party = party;
	}
	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}
	public void setThruDate(Date thruDate) {
		this.thruDate = thruDate;
	}
	public void setSupplierRatingType(SupplierRatingType supplierRatingType) {
		this.supplierRatingType = supplierRatingType;
	}
	public void setStandardLeadTimeDays(Long standardLeadTimeDays) {
		this.standardLeadTimeDays = standardLeadTimeDays;
	}
	public void setMinimumOrderQuantity(Long minimumOrderQuantity) {
		this.minimumOrderQuantity = minimumOrderQuantity;
	}
	public void setOrderQtyIncrements(Long orderQtyIncrements) {
		this.orderQtyIncrements = orderQtyIncrements;
	}
	public void setUnitsIncluded(Long unitsIncluded) {
		this.unitsIncluded = unitsIncluded;
	}
	public void setQuantityUom(Uom quantityUom) {
		this.quantityUom = quantityUom;
	}
	public void setAgreement(Agreement agreement) {
		this.agreement = agreement;
	}
	public void setAgreementItem(AgreementItem agreementItem) {
		this.agreementItem = agreementItem;
	}
	public void setLastPrice(Long lastPrice) {
		this.lastPrice = lastPrice;
	}
	public void setCurrencyUom(Uom currencyUom) {
		this.currencyUom = currencyUom;
	}
	public void setSupplierProductName(String supplierProductName) {
		this.supplierProductName = supplierProductName;
	}
	public void setSupplierProductId(String supplierProductId) {
		this.supplierProductId = supplierProductId;
	}
	public void setCanDropShip(String canDropShip) {
		this.canDropShip = canDropShip;
	}
	public void setSupplierCommissionPerc(Long supplierCommissionPerc) {
		this.supplierCommissionPerc = supplierCommissionPerc;
	} 
}
